<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>推广奖励结算系统 - 二级分销</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
        }
        
        :root {
            --primary: #3498db;
            --secondary: #2ecc71;
            --warning: #f39c12;
            --danger: #e74c3c;
            --light: #f8f9fa;
            --dark: #343a40;
            --gray: #6c757d;
            --border: #e0e0e0;
            --purple: #9b59b6;
            --success: #27ae60;
        }
        
        body {
            font-size: 14px;
            color: #333;
            line-height: 1.6;
            background: linear-gradient(135deg, #f8f9fa 0%, #eef2f7 100%);
            min-height: 100vh;
            padding: 15px;
        }
        
        .container {
            max-width: 750px;
            margin: 0 auto;
        }
        
        .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 0;
            margin-bottom: 15px;
        }
        
        .user-info {
            display: flex;
            align-items: center;
        }
        
        .user-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), #2980b9);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: bold;
            margin-right: 15px;
        }
        
        .user-name {
            font-weight: 600;
            margin-bottom: 5px;
        }
        
        .user-id {
            font-size: 12px;
            color: var(--gray);
        }
        
        .wallet-balance {
            background: white;
            padding: 8px 15px;
            border-radius: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            font-weight: 600;
            color: var(--warning);
        }
        
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 20px;
        }
        
        .stat-card {
            background: white;
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 3px 10px rgba(0,0,0,0.05);
            text-align: center;
        }
        
        .stat-value {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 5px;
        }
        
        .stat-label {
            font-size: 12px;
            color: var(--gray);
        }
        
        .card-1 .stat-value {
            color: var(--primary);
        }
        
        .card-2 .stat-value {
            color: var(--success);
        }
        
        .card-3 .stat-value {
            color: var(--purple);
        }
        
        .section {
            background: white;
            border-radius: 16px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.06);
            margin-bottom: 20px;
        }
        
        .section-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
        }
        
        .section-title h2 {
            font-size: 18px;
            font-weight: 600;
            display: flex;
            align-items: center;
        }
        
        .section-title h2 i {
            margin-right: 10px;
            color: var(--primary);
        }
        
        .referral-link {
            background: #f1f9ff;
            border-radius: 12px;
            padding: 15px;
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .link-text {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 14px;
            color: var(--gray);
            padding: 0 10px;
        }
        
        .copy-btn {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 8px 15px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .copy-btn:hover {
            background: #2980b9;
        }
        
        .share-buttons {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }
        
        .share-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: white;
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 12px 5px;
            font-size: 12px;
            color: var(--dark);
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .share-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        
        .share-btn i {
            font-size: 20px;
            margin-bottom: 5px;
        }
        
        .tabs {
            display: flex;
            background: #f1f5f9;
            border-radius: 12px;
            padding: 5px;
            margin-bottom: 20px;
        }
        
        .tab {
            flex: 1;
            text-align: center;
            padding: 10px;
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .tab.active {
            background: white;
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
            color: var(--primary);
        }
        
        .members-list {
            max-height: 300px;
            overflow-y: auto;
        }
        
        .member-item {
            display: flex;
            align-items: center;
            padding: 15px 0;
            border-bottom: 1px solid var(--border);
        }
        
        .member-item:last-child {
            border-bottom: none;
        }
        
        .member-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #e0e7ff;
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: bold;
            margin-right: 15px;
        }
        
        .member-info {
            flex: 1;
        }
        
        .member-name {
            font-weight: 500;
            margin-bottom: 3px;
        }
        
        .member-meta {
            display: flex;
            font-size: 12px;
            color: var(--gray);
        }
        
        .member-meta span {
            margin-right: 15px;
            display: flex;
            align-items: center;
        }
        
        .member-meta i {
            margin-right: 3px;
            font-size: 10px;
        }
        
        .member-amount {
            font-weight: 600;
            color: var(--success);
        }
        
        .withdraw-card {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            border-radius: 16px;
            padding: 20px;
            color: white;
            margin-bottom: 20px;
        }
        
        .withdraw-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }
        
        .withdraw-title i {
            margin-right: 10px;
        }
        
        .withdraw-amount {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 20px;
            text-align: center;
        }
        
        .withdraw-form {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 20px;
        }
        
        .form-group {
            margin-bottom: 15px;
        }
        
        .form-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
        }
        
        .form-control {
            width: 100%;
            padding: 12px 15px;
            border: none;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.9);
            font-size: 16px;
        }
        
        .amount-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin: 15px 0;
        }
        
        .amount-option {
            flex: 1;
            min-width: 80px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            padding: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            border: 1px solid transparent;
        }
        
        .amount-option.selected {
            background: white;
            color: var(--primary);
            font-weight: 600;
            border-color: white;
        }
        
        .btn {
            display: block;
            width: 100%;
            padding: 14px;
            border-radius: 12px;
            border: none;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
        }
        
        .btn-primary {
            background: white;
            color: var(--primary);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }
        
        .btn-primary:disabled {
            background: #cccccc;
            cursor: not-allowed;
        }
        
        .commission-list {
            max-height: 300px;
            overflow-y: auto;
        }
        
        .commission-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 0;
            border-bottom: 1px solid var(--border);
        }
        
        .commission-detail {
            flex: 1;
        }
        
        .commission-title {
            font-weight: 500;
            margin-bottom: 5px;
        }
        
        .commission-meta {
            font-size: 12px;
            color: var(--gray);
        }
        
        .commission-amount {
            font-weight: 600;
            color: var(--success);
        }
        
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--gray);
        }
        
        .empty-state i {
            font-size: 40px;
            margin-bottom: 15px;
            color: #d1d5db;
        }
        
        .level-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: 500;
            margin-left: 5px;
        }
        
        .level-1 {
            background: #dbeafe;
            color: #3b82f6;
        }
        
        .level-2 {
            background: #ede9fe;
            color: #8b5cf6;
        }
        
        .footer {
            text-align: center;
            padding: 20px 0;
            color: var(--gray);
            font-size: 12px;
        }
        
        .footer a {
            color: var(--primary);
            text-decoration: none;
        }
        
        .hidden {
            display: none;
        }
        
        .withdraw-history {
            margin-top: 20px;
        }
        
        .history-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
        }
        
        .history-info {
            flex: 1;
        }
        
        .history-title {
            font-weight: 500;
            margin-bottom: 3px;
        }
        
        .history-date {
            font-size: 12px;
            color: var(--gray);
        }
        
        .history-amount {
            font-weight: 600;
            color: var(--success);
        }
        
        .history-status {
            font-size: 12px;
            padding: 3px 8px;
            border-radius: 10px;
        }
        
        .status-success {
            background: #d1fae5;
            color: #047857;
        }
        
        .status-pending {
            background: #fef3c7;
            color: #b45309;
        }
        
        .commission-level {
            font-size: 12px;
            background: #f1f5f9;
            padding: 2px 8px;
            border-radius: 10px;
            display: inline-block;
            margin-top: 5px;
        }
        
        @media (max-width: 480px) {
            .stats-cards {
                grid-template-columns: 1fr;
            }
            
            .share-buttons {
                grid-template-columns: repeat(2, 1fr);
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="user-info">
                <div class="user-avatar">张</div>
                <div>
                    <div class="user-name">张推广员</div>
                    <div class="user-id">ID: PRO123456</div>
                </div>
            </div>
            <div class="wallet-balance">
                <i class="fas fa-wallet"></i> ¥1,245.80
            </div>
        </div>
        
        <div class="stats-cards">
            <div class="stat-card card-1">
                <div class="stat-value">28</div>
                <div class="stat-label">推广会员数</div>
            </div>
            <div class="stat-card card-2">
                <div class="stat-value">¥18,560</div>
                <div class="stat-label">消费金额</div>
            </div>
            <div class="stat-card card-3">
                <div class="stat-value">¥1,856</div>
                <div class="stat-label">提成金额</div>
            </div>
        </div>
        
        <div class="section">
            <div class="section-title">
                <h2><i class="fas fa-link"></i> 我的推广链接</h2>
            </div>
            
            <div class="referral-link">
                <i class="fas fa-link"></i>
                <div class="link-text">https://platform.com/ref?u=PRO123456</div>
                <button class="copy-btn" id="copyLinkBtn">复制链接</button>
            </div>
            
            <div class="share-buttons">
                <div class="share-btn">
                    <i class="fab fa-weixin"></i>
                    微信
                </div>
                <div class="share-btn">
                    <i class="fab fa-qq"></i>
                    QQ
                </div>
                <div class="share-btn">
                    <i class="fab fa-weibo"></i>
                    微博
                </div>
                <div class="share-btn">
                    <i class="fas fa-envelope"></i>
                    邮箱
                </div>
            </div>
        </div>
        
        <div class="section">
            <div class="section-title">
                <h2><i class="fas fa-users"></i> 我的会员</h2>
            </div>
            
            <div class="tabs">
                <div class="tab active" data-tab="level1">一级会员</div>
                <div class="tab" data-tab="level2">二级会员</div>
            </div>
            
            <div class="members-list" id="level1Members">
                <div class="member-item">
                    <div class="member-avatar">李</div>
                    <div class="member-info">
                        <div class="member-name">李小明 <span class="level-badge level-1">一级</span></div>
                        <div class="member-meta">
                            <span><i class="fas fa-calendar"></i> 2023-06-15</span>
                            <span><i class="fas fa-shopping-cart"></i> 消费 ¥2,450</span>
                        </div>
                    </div>
                    <div class="member-amount">¥245</div>
                </div>
                
                <div class="member-item">
                    <div class="member-avatar">王</div>
                    <div class="member-info">
                        <div class="member-name">王小红 <span class="level-badge level-1">一级</span></div>
                        <div class="member-meta">
                            <span><i class="fas fa-calendar"></i> 2023-07-02</span>
                            <span><i class="fas fa-shopping-cart"></i> 消费 ¥5,200</span>
                        </div>
                    </div>
                    <div class="member-amount">¥520</div>
                </div>
                
                <div class="member-item">
                    <div class="member-avatar">赵</div>
                    <div class="member-info">
                        <div class="member-name">赵小刚 <span class="level-badge level-1">一级</span></div>
                        <div class="member-meta">
                            <span><i class="fas fa-calendar"></i> 2023-07-22</span>
                            <span><i class="fas fa-shopping-cart"></i> 消费 ¥1,200</span>
                        </div>
                    </div>
                    <div class="member-amount">¥120</div>
                </div>
            </div>
            
            <div class="members-list hidden" id="level2Members">
                <div class="member-item">
                    <div class="member-avatar">陈</div>
                    <div class="member-info">
                        <div class="member-name">陈小华 <span class="level-badge level-2">二级</span></div>
                        <div class="member-meta">
                            <span><i class="fas fa-calendar"></i> 2023-06-20</span>
                            <span><i class="fas fa-shopping-cart"></i> 消费 ¥3,800</span>
                        </div>
                    </div>
                    <div class="member-amount">¥114</div>
                </div>
                
                <div class="member-item">
                    <div class="member-avatar">刘</div>
                    <div class="member-info">
                        <div class="member-name">刘小芳 <span class="level-badge level-2">二级</span></div>
                        <div class="member-meta">
                            <span><i class="fas fa-calendar"></i> 2023-07-10</span>
                            <span><i class="fas fa-shopping-cart"></i> 消费 ¥1,500</span>
                        </div>
                    </div>
                    <div class="member-amount">¥45</div>
                </div>
            </div>
        </div>
        
        <div class="withdraw-card">
            <div class="withdraw-title">
                <i class="fas fa-money-bill-wave"></i> 推广奖励提现
            </div>
            
            <div class="withdraw-amount">¥1,245.80</div>
            
            <div class="withdraw-form">
                <div class="form-group">
                    <label class="form-label">提现金额</label>
                    <input type="number" class="form-control" id="withdrawAmount" placeholder="输入提现金额" value="100">
                </div>
                
                <div class="form-group">
                    <label class="form-label">提现到微信</label>
                    <div class="form-control">微信账号: wechat_zhang123 (已绑定)</div>
                </div>
                
                <div class="amount-options">
                    <div class="amount-option">¥100</div>
                    <div class="amount-option selected">¥200</div>
                    <div class="amount-option">¥500</div>
                    <div class="amount-option">全部</div>
                </div>
                
                <button class="btn btn-primary" id="withdrawBtn">立即提现</button>
                <div class="note" style="text-align: center; margin-top: 10px; font-size: 12px;">
                    单笔最低提现¥100，24小时内到账
                </div>
            </div>
        </div>
        
        <div class="section">
            <div class="section-title">
                <h2><i class="fas fa-history"></i> 提现记录</h2>
            </div>
            
            <div class="withdraw-history">
                <div class="history-item">
                    <div class="history-info">
                        <div class="history-title">微信提现</div>
                        <div class="history-date">2023-07-25 14:30:22</div>
                    </div>
                    <div class="history-amount">-¥500.00</div>
                    <div class="history-status status-success">成功</div>
                </div>
                
                <div class="history-item">
                    <div class="history-info">
                        <div class="history-title">微信提现</div>
                        <div class="history-date">2023-07-18 10:15:07</div>
                    </div>
                    <div class="history-amount">-¥300.00</div>
                    <div class="history-status status-success">成功</div>
                </div>
                
                <div class="history-item">
                    <div class="history-info">
                        <div class="history-title">微信提现</div>
                        <div class="history-date">2023-07-10 16:45:33</div>
                    </div>
                    <div class="history-amount">-¥200.00</div>
                    <div class="history-status status-success">成功</div>
                </div>
            </div>
        </div>
        
        <div class="section">
            <div class="section-title">
                <h2><i class="fas fa-file-invoice-dollar"></i> 提成明细</h2>
            </div>
            
            <div class="commission-list">
                <div class="commission-item">
                    <div class="commission-detail">
                        <div class="commission-title">李小明 - 网站开发服务</div>
                        <div class="commission-meta">2023-07-28 10:30:22 | 订单号: ORD202307281030</div>
                        <div class="commission-level">一级会员 - 10%提成</div>
                    </div>
                    <div class="commission-amount">+¥245.00</div>
                </div>
                
                <div class="commission-item">
                    <div class="commission-detail">
                        <div class="commission-title">陈小华 - 设计服务</div>
                        <div class="commission-meta">2023-07-27 14:15:07 | 订单号: ORD202307271415</div>
                        <div class="commission-level">二级会员 - 3%提成</div>
                    </div>
                    <div class="commission-amount">+¥114.00</div>
                </div>
                
                <div class="commission-item">
                    <div class="commission-detail">
                        <div class="commission-title">王小红 - 咨询服务</div>
                        <div class="commission-meta">2023-07-25 09:45:33 | 订单号: ORD202307250945</div>
                        <div class="commission-level">一级会员 - 10%提成</div>
                    </div>
                    <div class="commission-amount">+¥520.00</div>
                </div>
            </div>
        </div>
        
        <div class="footer">
            <p>© 2023 创业服务平台 | 推广奖励系统</p>
            <p>客服电话：400-888-9999 | 工作日 9:00-18:00</p>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 会员级别切换
            const tabs = document.querySelectorAll('.tab');
            const level1Members = document.getElementById('level1Members');
            const level2Members = document.getElementById('level2Members');
            
            tabs.forEach(tab => {
                tab.addEventListener('click', function() {
                    tabs.forEach(t => t.classList.remove('active'));
                    this.classList.add('active');
                    
                    const tabType = this.dataset.tab;
                    level1Members.classList.add('hidden');
                    level2Members.classList.add('hidden');
                    
                    if (tabType === 'level1') {
                        level1Members.classList.remove('hidden');
                    } else {
                        level2Members.classList.remove('hidden');
                    }
                });
            });
            
            // 复制推广链接
            const copyLinkBtn = document.getElementById('copyLinkBtn');
            copyLinkBtn.addEventListener('click', function() {
                const link = "https://platform.com/ref?u=PRO123456";
                navigator.clipboard.writeText(link).then(() => {
                    const originalText = copyLinkBtn.textContent;
                    copyLinkBtn.textContent = '已复制!';
                    copyLinkBtn.style.background = '#2ecc71';
                    
                    setTimeout(() => {
                        copyLinkBtn.textContent = originalText;
                        copyLinkBtn.style.background = '';
                    }, 2000);
                });
            });
            
            // 金额选项选择
            const amountOptions = document.querySelectorAll('.amount-option');
            const withdrawAmount = document.getElementById('withdrawAmount');
            
            amountOptions.forEach(option => {
                option.addEventListener('click', function() {
                    amountOptions.forEach(o => o.classList.remove('selected'));
                    this.classList.add('selected');
                    
                    if (this.textContent === '全部') {
                        withdrawAmount.value = '1245.80';
                    } else {
                        withdrawAmount.value = this.textContent.replace('¥', '');
                    }
                });
            });
            
            // 提现按钮
            const withdrawBtn = document.getElementById('withdrawBtn');
            withdrawBtn.addEventListener('click', function() {
                const amount = parseFloat(withdrawAmount.value);
                if (amount < 100) {
                    alert('最低提现金额为¥100');
                    return;
                }
                
                if (amount > 1245.80) {
                    alert('提现金额不能超过可用余额');
                    return;
                }
                
                if (confirm(`确认提现¥${amount.toFixed(2)}到微信账号？`)) {
                    alert(`提现申请提交成功！¥${amount.toFixed(2)}将在24小时内到账`);
                    
                    // 更新余额显示
                    const walletBalance = document.querySelector('.wallet-balance');
                    const balance = parseFloat(walletBalance.textContent.replace(/[^\d.]/g, ''));
                    const newBalance = balance - amount;
                    walletBalance.innerHTML = `<i class="fas fa-wallet"></i> ¥${newBalance.toFixed(2)}`;
                    
                    // 更新提现金额显示
                    document.querySelector('.withdraw-amount').textContent = `¥${newBalance.toFixed(2)}`;
                    
                    // 添加到提现记录
                    const historyList = document.querySelector('.withdraw-history');
                    const now = new Date();
                    const dateStr = `${now.getFullYear()}-${String(now.getMonth()+1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`;
                    
                    const newItem = document.createElement('div');
                    newItem.className = 'history-item';
                    newItem.innerHTML = `
                        <div class="history-info">
                            <div class="history-title">微信提现</div>
                            <div class="history-date">${dateStr}</div>
                        </div>
                        <div class="history-amount">-¥${amount.toFixed(2)}</div>
                        <div class="history-status status-pending">处理中</div>
                    `;
                    
                    historyList.insertBefore(newItem, historyList.firstChild);
                    
                    // 重置金额输入
                    withdrawAmount.value = '100';
                    amountOptions.forEach(o => o.classList.remove('selected'));
                    amountOptions[0].classList.add('selected');
                }
            });
            
            // 分享按钮
            const shareButtons = document.querySelectorAll('.share-btn');
            shareButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const platform = this.textContent.trim();
                    alert(`"推广链接"将分享到${platform}`);
                });
            });
        });
    </script>
</body>
</html>